<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/plantilla/template.xhtml">
	<ui:define name="title">
		<h:outputText value="SAC - Informacion" />
	</ui:define>
	<ui:define name="principal">
		<h:form id="frmPro" enctype="multipart/form-data">
			<p:panel id="panel" header="Registrar Informacion del hotel">
				<p:fieldset>
					<p:messages id="messages" />
					<table align="center">
						<tr align="left">
							<td><p:outputLabel value="Nombre: " /></td>
							<td><p:inputText value="#{hotelBean.nombre}" /></td>
							<td></td>
						</tr>
					
						<tr align="left">
							<td><p:outputLabel value="Categoria: " /></td>
							<td><p:inputText value="#{hotelBean.categoria}" /></td>
							<td></td>
						</tr>
					<!-- rows="5" cols="30" -->
						<tr align="left">
							<td colspan="3">
							<p:fieldset legend="Detalle Principal">
							<table>
							<tr><td><p:inputTextarea counter="counter" maxlength="1024" rows="6" cols="53"      
    							counterTemplate="{0} caracteres disponibles." autoResize="false" value="#{hotelBean.detallePrincipal}"/></td></tr>
							<tr><td><h:outputText id="counter" /></td></tr>
							</table>

							</p:fieldset>
							</td>
						</tr>
						<tr><td colspan="3"><h:outputText>&nbsp;</h:outputText></td></tr>
						<tr>
							<td colspan="3" align="center">
								<p:fieldset id="img2" legend="Cargar imagen principal">
									<h:panelGroup>
										<p:fileUpload id="filImaPro" mode="advanced" 
										fileUploadListener="#{hotelBean.subirImagen}" fileLimit="1"
										sizeLimit="512000" allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
										cancelLabel="Cancelar" uploadLabel="Subir Imágen"
										label="Buscar archivo" required="true"/>               
										
									</h:panelGroup>
								</p:fieldset>
							</td>
						</tr>
						
						<tr><td colspan="3"><h:outputText>&nbsp;</h:outputText></td></tr>
						<tr>
							<td colspan="3" align="center">
								<p:fieldset id="img1" legend="Cargar Logo">
									<h:panelGroup>
										<p:fileUpload id="filLogPro" mode="advanced" 
										fileUploadListener="#{hotelBean.subirLogo}" fileLimit="1"
										sizeLimit="512000" allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
										cancelLabel="Subir Imágen" uploadLabel="Subir Imagen"
										label="Elegir" required="true"/>               
										
									</h:panelGroup>
								</p:fieldset>
							</td>
						</tr>
						
						<tr><td colspan="3"><h:outputText>&nbsp;</h:outputText></td></tr>
						<tr align="left">
							<td><p:outputLabel value="Dirección: " /></td>
							<td><p:inputText value="#{hotelBean.direccion}" /></td>
							<td></td>
						</tr>
						
						<tr align="left">
							<td><p:outputLabel value="Ciudad: " /></td>
							<td><p:inputText value="#{hotelBean.ciudad}" /></td>
							<td></td>
						</tr>
						
						<tr align="left">
							<td><p:outputLabel value="Hora de entrada: " /></td>
							<td><p:inputText value="#{hotelBean.hentrada}" /></td>
							<td></td>
						</tr>
						
						<tr align="left">
							<td><p:outputLabel value="Hora de salida: " /></td>
							<td><p:inputText value="#{hotelBean.hsalida}" /></td>
							<td></td>
						</tr>
						
					</table>
				</p:fieldset>
				
				<table align="center">
				<tr><td><h:outputText>&nbsp;</h:outputText></td></tr>
				<tr><td><p:commandButton value="Actualizar Datos" update="panel"
					action ="#{hotelBean.actualizarDatos}"
					styleClass="ui-priority-primary"/></td></tr>
				</table>
				
			</p:panel>

		</h:form>
	</ui:define>

</ui:composition>
</html>